import json
import time,logging

t=time.strftime('%Y%m%d-%H%M%S',time.localtime())

def get_logger(name='test_baidu'):
    logger=logging.getLogger(name)

    if not logger.handlers:
        fmt=logging.Formatter('%(asctime)s-> %(levelname)s-> %(filename)s-> %(message)s')

        file_hd=logging.FileHandler(r'/test_baidu.py', encoding='utf8')
        file_hd.setFormatter(fmt)
        logger.addHandler(file_hd)

        cont_hd=logging.StreamHandler()
        cont_hd.setFormatter(fmt)
        logger.addHandler(cont_hd)

        logger.setLevel(logging.INFO)

    return logger

def test_json():
    with open(r'/\data\json.json', 'r', encoding='utf8')as e:
        return json.load(e)